package com.idea.zd.sys.quartz;

import com.jfinal.kit.HttpKit;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.util.logging.Logger;

import static java.util.logging.Logger.getLogger;

public class IqiyiJobMonth implements Job {
    private static final Logger log = getLogger(String.valueOf(IqiyiJobMonth.class));
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        IqiyiJob job1 = new IqiyiJob(100,1);
        IqiyiJob job2 = new IqiyiJob(200,101);
        IqiyiJob job3 = new IqiyiJob(300,201);
        IqiyiJob job4 = new IqiyiJob(400,301);
        IqiyiJob job5 = new IqiyiJob(500,401);

        Thread t1 = new Thread(job1,"月线程1");
        Thread t2 = new Thread(job2,"月线程2");
        Thread t3 = new Thread(job3,"月线程3");
        Thread t4 = new Thread(job4,"月线程4");
        Thread t5 = new Thread(job5,"月线程5");

        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();

        try {
            t1.join();
            t2.join();
            t3.join();
            t4.join();
            t5.join();

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        HttpKit.post("http://app.fansiji.com/h5/iqiyi/Home/week","");
        log.info("http://app.fansiji.com/h5/iqiyi/Home/week");
        System.out.println("http://app.fansiji.com/h5/iqiyi/Home/week");
        HttpKit.post("http://api.fansiji.com/sys_db/getAiqiyiUrl","");
        log.info("http://api.fansiji.com/sys_db/getAiqiyiUrl");
        System.out.println("http://api.fansiji.com/sys_db/getAiqiyiUrl");
        HttpKit.post("http://app.fansiji.com/h5/iqiyi/Home/index","");
        log.info("http://app.fansiji.com/h5/iqiyi/Home/index");
        System.out.println("http://app.fansiji.com/h5/iqiyi/Home/index");
        HttpKit.post("http://app.fansiji.com/h5/iqiyi/Home/month","");
        log.info("http://app.fansiji.com/h5/iqiyi/Home/month");
        System.out.println("http://app.fansiji.com/h5/iqiyi/Home/month");

    }
}
